﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<MensUnoShop.Models.ViewModels.RegionViewModel>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	men'suno SHOP
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
<script language="javascript" type="text/javascript">
    $(function () {
        $("#password").charCounter(8, { container: "#counter", format: "%1 ", delay: 100 });
        $("#confirm").charCounter(8, { container: "#counter", format: "%1 ", delay: 100 });
        $("#telh_pre").charCounter(3, { container: "#counter", format: "%1 ", delay: 100 });
        $("#telh").charCounter(8, { container: "#counter", format: "%1 ", delay: 100 });
        $("#telo_pre").charCounter(3, { container: "#counter", format: "%1 ", delay: 100 });
        $("#telo").charCounter(8, { container: "#counter", format: "%1 ", delay: 100 });
        $("#mobile").charCounter(10, { container: "#counter", format: "%1 ", delay: 100 });
        $("#zip").charCounter(5, { container: "#counter", format: "%1 ", delay: 100 });
        $("#telh_pre").numeric();
        $("#telh").numeric();
        $("#telo_pre").numeric();
        $("#telo").numeric();
        $("#mobile").numeric();
        $("#zip").numeric();
        $("#email").alphanumeric({
            allow: "@._- "
        });
    });
    function go() {
        var msg = "請確認以下欄位\n";
        if (!chkemail()) {
            msg += "E-Mail：請輸入正確的E-Mail信箱\n";
        }
        if ($("#password").val() == "" || $("#password").val().length < 6 || $("#password").val().length > 8) {
            msg += "會員密碼：請輸入6-8位英數字\n";
        }
        if ($("#confirm").val() == "" || $("#confirm").val().length < 6 || $("#confirm").val().length > 8 || $("#password").val() != $("#confirm").val()) {
            msg += "密碼確認：請輸入6-8位英數字，且需與會員密碼欄位相同\n";
        }
        if ($("#firstname").val() == "" || $("#lastname").val() == "") {
            msg += "會員姓名：未輸入會員姓名\n";
        }
        if (!chkphone()) {
            msg += "聯絡電話：請至少輸入一組正確的聯絡電話\n";
        }
        if ($("#zip").val() == "" || $("#city").val() == "" || $("#area").val() == "" || $("#address").val() == "") {
            msg += "居住地址：請輸入完整的地址資料\n";
        }

        if (msg != "請確認以下欄位\n") {
            alert(msg);
        }
        else {
            $('#form1').submit();
        }
    }
    function chkemail() {
        var mail_check = /.+@.+\..+/;
        if (!$("#email").val().match(mail_check)) {
            return false;
        }
        else
            return true;
    }
    function chkphone() {
        var isfill = true;
        if ($("#telh_pre").val() == "" && $("#telo_pre").val() == "" && $("#mobile").val() == "") {
            isfill = false;
        }
        if (($("#telh_pre").val() != "" && $("#telh").val() == "") || ($("#telh_pre").val() == "" && $("#telh").val() != "")) {
            isfill = false;
        }
        if (($("#telo_pre").val() != "" && $("#telo").val() == "") || ($("#telo_pre").val() == "" && $("#telo").val() != "")) {
            isfill = false;
        }
        return isfill;
    }
</script>

    <div class="CONTENT_LEFT">
        <ul>
            <%Html.RenderPartial("/Views/Shared/SearchBox.ascx"); %>
            <%Html.RenderPartial("/Views/Shared/ProductTitle.ascx", Model.LEFTTAG); %>
            <%Html.RenderPartial("/Views/Shared/HotSearch.ascx", Model.HOTKEYLIST); %>
            <%Html.RenderPartial("/Views/Shared/News.ascx",Model.NEWS); %>
        </ul>
    </div>
    <div class="CONTENT_RIGHT">
    <img src="/Content/page_img/content2_top.gif">
    <div class="JOIN_MEMBER_TITLE">
    <!--div class="ECOUPON">
    <h1 class="ECOUPON_TITLE">加入會員</h1>
    <ul>
      <form action="/member/addcoupon" method="post">
      <li>網路優惠券輸序號入：<input type="text" class="MEMBER_BOX" name="id">
        <input type="submit" name="button" id="button" value="送出">
      </li>
      </form>
      <%if (Model.MEMBER.COUPON.Count(sc=>!sc.ISUSED)>0)
        { %>
      <li>您現在有：
      <%    var c = from sc in Model.MEMBER.COUPON where !sc.ISUSED group sc by sc.PRICE into g select new { Price = g.Key, Amount = g.Count() };
            foreach (var ci in c)
            { %><span class="FONT_GREEN"><%:ci.Price%> 元 <%:ci.Amount%>張</span>；<%} %></li>
      <%}else{ %>
        您現在沒有任何優惠券!!
      <%} %>
      <li>每次消費只能使用1張；可與其它活動合併使用</li>
    </ul>
    </div-->

    <form id="form1" name="form1" class="vt" action="" method="post">

    <h1 class="EDIT_MEMBER_TITLE">修改會員資料</h1>
    <table width="500" border="0" align="center" cellpadding="0" cellspacing="0">
      <tbody>
      <tr>
        <td width="100" align="right">email 帳號：</td>
        <td><%:Model.MEMBER.EMAIL %><%:Html.Hidden("email", Model.MEMBER.EMAIL)%></td>
      </tr>
      <tr>
        <td align="right">密碼：</td>
        <td><%:Html.Password("password", "", new { @class = "MEMBER_BOX" })%></td>
      </tr>
      <tr>
        <td align="right">密碼確認：</td>
        <td><%:Html.Password("confirm", "", new { @class = "MEMBER_BOX" })%></td>
      </tr>
    </tbody>
    </table>

    <h2>基本資料</h2>
    <table  border="0" align="center" cellpadding="0" cellspacing="0">
      <tbody><tr>
        <td width="173" align="right">姓名name：</td>
        <td>姓Last  name<%:Html.TextBox("lastname", Model.MEMBER.LASTNAME, new { size = 10, @class = "MEMBER_BOX" })%>          
          名First  name<%:Html.TextBox("firstname", Model.MEMBER.FIRSTNAME, new { size = 10, @class = "MEMBER_BOX" })%>
        </td>
      </tr>
      <tr>
        <td align="right"></td>
        <td>
          <%: Html.RadioButton("sex", false, Model.MEMBER.SEX == false)%>先生Male
          <%: Html.RadioButton("sex", true, Model.MEMBER.SEX == true)%>小姐Female  
        </td>
      </tr>
      <tr>
        <td align="right">聯絡電話Tel：</td>
        <td>住家(H)
          <%:Html.TextBox("telh_pre", ViewData["telh_pre"], new { size = 5, @class = "MEMBER_BOX" })%>
          <%:Html.TextBox("telh", ViewData["telh"], new { size = 15, @class = "MEMBER_BOX" })%>
        </td>
      </tr>
      <tr>
        <td align="right">&nbsp;</td>
        <td>公司(O)
          <%:Html.TextBox("telo_pre", ViewData["telo_pre"], new { size = 5, @class = "MEMBER_BOX" })%>
          <%:Html.TextBox("telo", ViewData["telo"], new { size = 15, @class = "MEMBER_BOX" })%>
        </td>
      </tr>
      <tr>
        <td align="right">&nbsp;</td>
        <td>行動電話(Mobile)
          <%:Html.TextBox("mobile", Model.MEMBER.MOBILE, new { size = 20, @class = "MEMBER_BOX" })%>
        </td>
      </tr>
      <tr>
        <td align="right">婚姻狀況Marital status：</td>
        <td>
            <%: Html.RadioButton("ismarried", false, Model.MEMBER.ISMARRIED == false)%>未婚Unmarried
            <%: Html.RadioButton("ismarried", true, Model.MEMBER.ISMARRIED == true)%>已婚Married  
        </td>
      </tr>
      <tr>
        <td align="right">出生年月日Birthday：</td>
        <td>
            <%:Model.MEMBER.BIRTH%>
        </td>
      </tr>
      <tr>
        <td align="right">學歷Education：</td>
        <td>
            <%:Html.DropDownList("degree", (SelectList)ViewData["degreeList"])%>
        </td>
      </tr>
      <tr>
        <td align="right">職業Occupation：</td>
        <td>
            <%:Html.DropDownList("job", (SelectList)ViewData["jobList"])%>
        </td>
      </tr>
      <tr>
        <td align="right">月收入Monthly  income(NTD)：</td>
        <td>
            <%:Html.DropDownList("income", (SelectList)ViewData["incomeList"])%>            
        </td>
      </tr>
      <tr>
        <td align="right">居住地址Address：</td>
        <td valign="top">國家：
            <%:Html.DropDownList("country", (SelectList)ViewData["countryList"])%>          
        </td>
      </tr>
      <tr>
        <td align="right">&nbsp;</td>
        <td valign="top">郵遞區號：
            <%:Html.TextBox("zip", Model.MEMBER.ZIP, new { size = 10, @maxlength = 6 })%>
        </td>
      </tr>
      <tr>
        <td align="right">&nbsp;</td>
        <td valign="top"><font face="新細明體">縣市/地區 ：</font>
          <%:Html.TextBox("city", Model.MEMBER.CITY, new { size = 10, @style = "width:112px;", @maxlength = 15 })%>          
        </td>
      </tr>
      <tr>
        <td align="right">&nbsp;</td>
        <td valign="top"><font face="新細明體">鄉/鎮/市/行政區：</font>
          <%:Html.TextBox("area", Model.MEMBER.AREA, new { size = 10, @style = "width:112px;", @maxlength = 15 })%>
        </td>
      </tr>
      <tr>
        <td align="right">&nbsp;</td>
        <td valign="top"><font face="新細明體">地址：</font>
          <%:Html.TextBox("address", Model.MEMBER.ADDRESS, new { size = 38, @maxlength = 150 })%>
        </td>
      </tr>
      <tr>
      <td align="right">是否訂閱電子報Subscribe EDM：</td>
        <td><input name="isedm" type="radio"  value="true" <%if(Model.MEMBER.ISEDM){%>checked="checked"<%} %> />
          是Agree　
            <input type="radio" name="isedm" value="false" <%if(!Model.MEMBER.ISEDM){%>checked="checked"<%} %> />
            否No</td>
      </tr>
    </tbody>
    </table>
    
    </form>

    <div class="PRODUCT_COMES_BT">
    <ul>
    <li><a href="javascript:go();">確認送出</a></li>
    <li><a href="/">取消回返</a></li>
    </ul>
    <br class="CLEAR" />
    </div>
    </div>
    <img src="/Content/page_img/content2_bottom.gif"></div>
    <br class="CLEAR" />
</asp:Content>
